package com.pubinfo.passbook.common.service.contract;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pubinfo.passbook.common.entity.TContractBase;
import com.pubinfo.passbook.common.enums.ContractStatusEnum;
import com.pubinfo.passbook.common.model.dto.contract.*;
import com.pubinfo.passbook.common.model.vo.base.JsonResult;
import com.pubinfo.passbook.common.model.vo.base.MyPage;
import com.pubinfo.passbook.common.model.vo.base.ResultCode;
import com.pubinfo.passbook.common.model.vo.contract.ContractBaseExcel;
import com.pubinfo.passbook.common.model.vo.contract.ContractDetailInfoVo;
import com.pubinfo.passbook.common.model.vo.contract.ContractDetailVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author admin
 * @description 针对表【t_contract_base(合同基础信息表)】的数据库操作Service
 * @createDate 2021-12-03 10:37:58
 */
public interface TContractBaseService extends IService<TContractBase> {
  
  /**
     * 根据ID获取合同
     */
    TContractBase getContractById(Integer id);
  
  /**
   * 查询合同管理列表
   */
  MyPage<TContractBase> selectContractList(ContractListParam param);

    /**
     * 查询合同信息
     */
    ContractDetailInfoVo contractInfo(ContractIdParam param);

    /**
     * 查询合同详情
     */
    ContractDetailVo contractDetail(ContractIdParam param);

    /**
     * 合同认领
     */
    JsonResult<ResultCode> contractAdopt(String acct, ContractAdoptParam param);
  
  JsonResult<ResultCode> cancelAdopt(String acct, ContractIdParam param);
  
  Boolean contractAdopt(String acct, String contractCode);
  
  List<ContractBaseExcel> listByStatus(ContractStatusEnum status);
  
  /**
   * 合同关闭
   */
  JsonResult<ResultCode> contractClose(String acct, ContractIdParam param);

    /**
     * 更改可开票金额
     */
    boolean modifyInvoiceAmount(Integer contractId, BigDecimal amount);

  /**
   * 获取已认领合同情况查询
   */
  MyPage<ClaimedList> getContractClaimedList(ContractTrialParam page);
  
  /**
   * 下载已认领合同
   */
  List<ClaimedList> getContractDownloadExcal(ContractTrialParam param);

  /**
   * 获取合同清洗结果
   */
  MyPage<ContractClearResultList> selectContractClearResultList(ContractClaerParam param);

  /**
   * 下载合同清洗结果
   */
  List<ContractClearResultList> getContractClearResulDownloadExcal(ContractClaerParam param);

}
